package 并发;

import com.sun.deploy.net.proxy.ProxyUnavailableException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-16
 * Time: 13:30
 */
public class TestThreadDemo1 {
    public static void main(String[] args) {
        Thread t = new Thread("t1"){
            @Override
            public void run() {
                method(10);//t1线程调用的方法
            }
        };
        t.start();
        method(10);//主线程调用的方法
    }
    public static void method(int x){
        int y = x + 1;
        Object m = method2();
        System.out.println(m);
    }
    public static Object method2(){
        Object n = new Object();
        return n;
    }
}
